<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <title>欢迎访问{{ houseInfo.houseName }}主页</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="/static/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/js/jquery-3.5.1.min.js"></script>
    <script src="/static/js/bootstrap.min.js"></script>
</head>

<body>
    <!-- Static navbar -->
    <nav class="navbar navbar-default navbar-static-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar"
                    aria-expanded="false" aria-controls="navbar">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="/">
                    <img alt="Brand" width="20" height="20" src="/files/{{ houseInfo.brand }}">
                </a>
            </div>
            <div id="navbar" class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li class="active"><a href="/">主页</a></li>
                    <li><a href="#contact">联系我们</a></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                            aria-expanded="false">更多<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="#">帮助</a></li>
                            <li role="separator" class="divider"></li>
                            <li class="dropdown-header">管理员通道</li>
                            <li><a href="admin/">管理员登录</a></li>
                        </ul>
                    </li>
                </ul>
                <ul class="nav navbar-nav navbar-right">
                    {% if request.user.is_authenticated %}
                    <li><a href="#">{{ request.user.username }}</a></li>
                    <li class="dropdown">
                        <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
                            aria-expanded="false">已登录<span class="caret"></span></a>
                        <ul class="dropdown-menu">
                            <li><a href="{% url 'user:usermgr' %}">用户管理</a></li>
                            <li><a href="#" data-toggle="modal" data-target=".modal">修改密码</a></li>
                            <li role="separator" class="divider"></li>
                            <li><a href="{% url 'user:logout' %}">退出登录</a></li>
                        </ul>
                        {% else %}
                    <li><a href="{% url 'user:login' %}">登录</a></li>
                    <li><a href="{% url 'user:reg' %}">注册</a></li>
                    {% endif %}
                </ul>
            </div>
            <!--/.nav-collapse -->
        </div>
    </nav>
    <div class="container">
        <div class="page-header">
            <h1>欢迎访问{{ houseInfo.houseName }} <small>{{ houseInfo.houseSlogan }}</small></h1>
        </div>
    </div>
    <div class="container">
        <!-- Main component for a primary marketing message or call to action -->
        <div class="jumbotron">
            <h1>关于我们</h1>
            <p>{{ houseInfo.houseDesc }}</p>
            <p>地址:{{ houseInfo.location }}</p>
            <a class="btn btn-lg btn-primary" href="{% url 'user:reg' %}" role="button">注册&laquo;</a>
            <a class="btn btn-lg btn-success" href="{% url 'user:login' %}" role="button">登录&raquo;</a>
        </div>
    </div> <!-- /container -->
    </div>
    </div>
    {% if request.user.is_authenticated %}
    <!--.modal -->
    <div class="modal fade" tabindex="-1" role="dialog">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                    <h4 class="modal-title">用户密码修改</h4>
                </div>
                <div class="modal-body">
                    <form id="rspwdForm" class="">
                        {% csrf_token %}
                        <div class='form-group'>
                            <br>
                            <label for="username">用户名</label>
                            <input type="text" name="username" id="username" disabled class="form-control"
                                   value="{{ request.user.username }}">
                        </div>
                        {% for form in rspwdForm %}
                        <div class='form-group'>
                            <label for="{{ form.auto_id }}">{{ form.label }}</label>
                            {{ form }}
                            <span style='color: red' class="pull-right">{{ form.errors.0 }}</span>
                        </div>
                        {% endfor %}
                    </form>
                </div>
                <div class="modal-footer">
                    <button id="btn_cancel" type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <button type="button" id="btn_commit" class="btn btn-primary">确认修改</button>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    {% endif %}

    <script src="/static/js/getcsrftoken.js"></script>
    <script src="/static/js/reset_password.js"></script>
</body>

</html>